






<div class="x-body">
    <form class="layui-form form_single" id="form" action="{:url()}" method="post">

        <!--<div class="layui-form-item">-->
            <!--<label for="ranking" class="layui-form-label">-->
               <!--排名-->
            <!--</label>-->
            <!--<div class="layui-input-block">-->
                <!--<input type="number" id="ranking" name="ranking"-->
                       <!--autocomplete="off" class="layui-input"  value="{$info['ranking']|default=0}">-->
            <!--</div>-->
            <!--<div class="layui-form-mid layui-word-aux">-->
               <!--排名-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label for="pid" class="layui-form-label">
                <span class="x-red">*</span>赌王
            </label>
            <div class="layui-input-block">
                <select id="pid" name="king_id">
                    {volist name='king' id='vo'}

                    <option value="{$vo.id}" {notempty name="info" }{if condition="  $info['king_id'] eq $vo['id']"} selected {/if}{/notempty}>{$vo.name}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">
                (所属赌王)
            </div>

        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="x-red">*</span>动态内容
            </label>
            <div class="layui-input-block">
                <textarea class="form-control textarea_editor" name="content" placeholder="请输入动态内容">{$info['content']|default=''}</textarea>
                {:widget('editor/index', array('name'=> 'content','value'=> ''))}
            </div>
        </div>


        <div class="box-footer">
            <input type="hidden" name="id" value="{$info['id']|default='0'}"/>

            {include file="layout/edit_btn_group"/}

        </div>

    </form>
</div>

<script>
    layui.use('form', function(){
        var form = layui.form;

        form.on('select(aihao)', function(data){
            console.log(data.elem); //得到select原始DOM对象
            console.log(data.value); //得到被选中的值
            console.log(data.othis); //得到美化后的DOM对象
            if(data.value==1){
                $('#video_url').hide();
                $('#video').show();
            }else{
                $('#video_url').show();
                $('#video').hide();
            }

            form.render(null, 'form');
        });


    });


    function changevideo(v) {
        if(v==1){
            $('#video').show();
            $('#video_url').hide();
        }else{
            $('#video_url').show();
            $('#video').hide();
        }
    }
</script>
